**********************************************************************************************
//*SET USER*//
*Users Identification Code
*User 1
*User 2


//Set user below:
global user 1

//Enter the filepath of where the Master Folder is located//
*********************************************************
//User 1
if $user == 1 {
	global FH ""
}
**********************************************************
//User 2
if $user == 2 {

	global FH 
}
************************************************************
************************************************************
//GENERATING SCORES
do "$FH/do/Scores/PHL_HOC_Scores.do"
set more off
******************************************************************************************
//*RE-CLASSIFICATION OF BASELINE PARAMETERS*//
**********************************************************************************
///RENAMING INDICATOR ON WHETHER A PERSON OWNS A PHONE///
tab b_qg1
rename b_qg1 b_ownphone
tab b_ownphone
replace b_ownphone =. if b_ownphone < 0

//GENERATE A VARIABLE FOR STRATIFICATION-NUMBER OF CLIENTS IN EACH GROUP//
bysort groupidentifier: gen stratum = _N
tab stratum
bysort stratum: tab tcarm

******************************************************************************************
//*RE-CLASSIFICATION OF BASELINE PARAMETERS*//
///CLASSIFICATION OF RETAIL TYPE INTO 3 NEW TYPES: "SARI SARI STORE", "FOOD RETAIL" AND "NON-FOOD RETAIL"///
tab b_retailtype
tab b_retailtype, nol
gen b_retailtype_new = 1 if b_retailtype == 1
replace b_retailtype_new = 3 if b_retailtype == 8
replace b_retailtype_new = 2 if b_retailtype_new != 1 & b_retailtype_new != 3
tab b_retailtype_new
label variable b_retailtype_new "Revised Retail Type Classification"
label define retailnew 1"Sari Sari Store" 2"Food Retail" 3"Non-food Retail"
label values b_retailtype_new retailnew
tab b_retailtype_new
tab b_retailtype_new, nol
tab b_retailtype_new, gen(b_retailtype_new_)
*********************************************************************************
///RE-CLASSIFICATION OF EDUCATION INTO 4 LEVELS: "LESS THAN 5TH CLASS", "ABOVE 5TH CLASS", "COMPLETED HIGH SCHOOL" & "GRADUATE/POST-GRADUATE"///
tab b_education
tab b_education, nol
gen b_education_new = 1 if b_education <= 2
replace b_education_new = 2 if b_education == 3
replace b_education_new = 3 if b_education == 4
replace b_education_new = 4 if b_education >= 5
tab b_education_new
label variable b_education_new "Revised Education Level"
label define educationnew 1"Less than 5th Grade" 2"Above 5th Grade" 3"Completed High School" 4"Graduate/Post graduate"
label values b_education_new educationnew
tab b_education_new
tab b_education_new, nol
tab b_education_new, gen(b_education_new_)
**********************************************************************************
///RECLASSIFICATION OF EDUCATION INTO 2 LEVELS- HSGrad (high) vs otherwise (low)///
tab b_education
tab b_education, nol
gen b_education_new2 = 1 if b_education >= 4
replace b_education_new2 = 0 if b_education < 4
tab b_education_new
label variable b_education_new2 "revised education level"
label define educationnew2 0"low" 1"high"
label values b_education_new2 educationnew2
tab b_education_new2
tab b_education_new2, nol
**********************************************************************************
///RECLASSIFICATION OF AGE OF BUSINESS INTO 2 GROUPS: OLD (>=3 yrs) VS YOUNG (<3 yrs)*/
tab b_ageofbus
gen b_ageofbus_new = 1 if b_ageofbus >= 3
replace b_ageofbus_new = 0 if b_ageofbus < 3
tab b_ageofbus_new
label variable b_ageofbus_new "revised age of business"
label define ageofbusnew 0"young" 1"old"
label values b_ageofbus_new ageofbusnew
tab b_ageofbus_new
tab b_ageofbus_new, nol
******************************************************************************************
******************************************************************************************
//*GENERATING CATEGORIES FOR AGE OF ENTREPRENEUR, BASELINE BUSINESS SIZE, BASELINE BUSINESS PRACTICES & LEVEL OF EDUCATION*//
//EDUCATION LEVEL
tab b_education
tab b_education_new
tab b_education_new, nol
//We will group education as follows: High School & Above coded as '0' and Less than High School as '1'
gen education_dummy =.
replace education_dummy = 0 if b_education_new >= 3
replace education_dummy = 1 if b_education_new < 3
tab education_dummy
/*Generating Interaction Term*/
gen tcarm_education = tcarm*education_dummy
tab tcarm_education

//AGE OF ENTREPRENEUR
tab b_age
summarize b_age, de
//We will split age of entrepreneur as follows: Above Median Age coded as '0' and Below Median Age coded as '1'
gen age_dummy = .
replace age_dummy = 0 if b_age > 45
replace age_dummy = 1 if b_age <= 45
tab age_dummy
/*Generating Interaction Term*/
gen tcarm_age = tcarm*age_dummy
tab tcarm_age

//BASELINE BUSINESS SIZE
summarize b_salesregwk, de
summarize w1b_salesregwk, de
//We will split business size as follows: Above median baseline regular week sales as '0' and Below and equal median regular week sales as '1'
gen size_dummy =.
replace size_dummy = 0 if w1b_salesregwk > 3500
replace size_dummy = 1 if w1b_salesregwk <= 3500
tab size_dummy
/*Generating Interaction Term*/
gen tcarm_size = tcarm*size_dummy
tab tcarm_size

//BASELINE BUSINESS PRACTICES
summarize b_training_score, de
//We will split business practices as follows: Above median baseline training score as '0' and Below and equal median training score as '1'
gen prac_dummy = .
replace prac_dummy = 0 if b_training_score > 1.875
replace prac_dummy = 1 if b_training_score <= 1.875
tab prac_dummy
/*Generating Interaction Term*/
gen tcarm_prac = tcarm*prac_dummy
tab tcarm_prac

***********************************************
****************TABLE 5A VALUES****************
***********************************************
///REGRESSIONS
///Level of Education
regress e_training_score b_training_score tcarm tcarm_education education_dummy age_dummy size_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar edt11 = round(_b[tcarm], 0.0001)
scalar edse11 = round(_se[tcarm], 0.01)
scalar edp11 = round(r(table)[4,2], 0.001)

scalar edt12 = round(_b[education_dummy], 0.0001)
scalar edse12 = round(_se[education_dummy], 0.01)
scalar edp12 = round(r(table)[4,4], 0.001)

scalar edt13 = round(_b[tcarm_education], 0.0001)
scalar edse13 = round(_se[tcarm_education], 0.01)
scalar edp13 = round(r(table)[4,3], 0.001)

scalar Ned1 = e(N)

regress w1e_salesregwk w1b_salesregwk tcarm tcarm_education education_dummy age_dummy size_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar edt21 = round(_b[tcarm], 0.1)
scalar edse21 = round(_se[tcarm], 0.01)
scalar edp21 = round(r(table)[4,2], 0.001)

scalar edt22 = round(_b[education_dummy], 0.1)
scalar edse22 = round(_se[education_dummy], 0.01)
scalar edp22 = round(r(table)[4,4], 0.001)

scalar edt23 = round(_b[tcarm_education], 0.1)
scalar edse23 = round(_se[tcarm_education], 0.01)
scalar edp23 = round(r(table)[4,3], 0.001)

scalar Ned2 = e(N)

regress w1e_profitregwk w1b_profitregwk tcarm tcarm_education education_dummy age_dummy size_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar edt31 = round(_b[tcarm], 0.1)
scalar edse31 = round(_se[tcarm], 0.01)
scalar edp31 = round(r(table)[4,2], 0.001)

scalar edt32 = round(_b[education_dummy], 0.1)
scalar edse32 = round(_se[education_dummy], 0.01)
scalar edp32 = round(r(table)[4,4], 0.001)

scalar edt33 = round(_b[tcarm_education], 0.1)
scalar edse33 = round(_se[tcarm_education], 0.01)
scalar edp33 = round(r(table)[4,3], 0.001)

scalar Ned3 = e(N)

///Age of Entrepreneur
regress e_training_score b_training_score tcarm tcarm_age age_dummy education_dummy size_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar aget11 = round(_b[tcarm], 0.0001)
scalar agese11 = round(_se[tcarm], 0.01)
scalar agep11 = round(r(table)[4,2], 0.001)

scalar aget12 = round(_b[age_dummy], 0.0001)
scalar agese12 = round(_se[age_dummy], 0.01)
scalar agep12 = round(r(table)[4,4], 0.001)

scalar aget13 = round(_b[tcarm_age], 0.0001)
scalar agese13 = round(_se[tcarm_age], 0.01)
scalar agep13 = round(r(table)[4,3], 0.001)


scalar Nage1 = e(N)

regress w1e_salesregwk w1b_salesregwk tcarm tcarm_age age_dummy education_dummy size_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar aget21 = round(_b[tcarm], 0.1)
scalar agese21 = round(_se[tcarm], 0.01)
scalar agep21 = round(r(table)[4,2], 0.001)

scalar aget22 = round(_b[age_dummy], 0.1)
scalar agese22 = round(_se[age_dummy], 0.01)
scalar agep22 = round(r(table)[4,4], 0.001)

scalar aget23 = round(_b[tcarm_age], 0.1)
scalar agese23 = round(_se[tcarm_age], 0.01)
scalar agep23 = round(r(table)[4,3], 0.001)

scalar Nage2 = e(N)

regress w1e_profitregwk w1b_profitregwk tcarm tcarm_age age_dummy education_dummy size_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar aget31 = round(_b[tcarm], 0.1)
scalar agese31 = round(_se[tcarm], 0.01)
scalar agep31 = round(r(table)[4,2], 0.001)

scalar aget32 = round(_b[age_dummy], 0.1)
scalar agese32 = round(_se[age_dummy], 0.01)
scalar agep32 = round(r(table)[4,4], 0.001)

scalar aget33 = round(_b[tcarm_age], 0.1)
scalar agese33 = round(_se[tcarm_age], 0.01)
scalar agep33 = round(r(table)[4,3], 0.001)

scalar Nage3 = e(N)

	
***********************************************
****************TABLE 6A VALUES****************
***********************************************

//Size of Business

regress e_training_score b_training_score tcarm tcarm_size size_dummy education_dummy age_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar sizet11 = round(_b[tcarm], 0.0001)
scalar sizese11 = round(_se[tcarm], 0.01)
scalar sizep11 = round(r(table)[4,2], 0.001)

scalar sizet12 = round(_b[size_dummy], 0.0001)
scalar sizese12 = round(_se[size_dummy], 0.01)
scalar sizep12 = round(r(table)[4,4], 0.001)

scalar sizet13 = round(_b[tcarm_size], 0.0001)
scalar sizese13 = round(_se[tcarm_size], 0.01)
scalar sizep13 = round(r(table)[4,3], 0.001)


scalar Nsize1 = e(N)

regress w1e_salesregwk w1b_salesregwk tcarm tcarm_size size_dummy education_dummy age_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar sizet21 = round(_b[tcarm], 0.1)
scalar sizese21 = round(_se[tcarm], 0.01)
scalar sizep21 = round(r(table)[4,2], 0.001)

scalar sizet22 = round(_b[size_dummy], 0.1)
scalar sizese22 = round(_se[size_dummy], 0.01)
scalar sizep22 = round(r(table)[4,4], 0.001)

scalar sizet23 = round(_b[tcarm_size], 0.1)
scalar sizese23 = round(_se[tcarm_size], 0.01)
scalar sizep23 = round(r(table)[4,3], 0.001)

scalar Nsize2 = e(N)

regress w1e_profitregwk w1b_profitregwk tcarm tcarm_size size_dummy education_dummy age_dummy prac_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar sizet31 = round(_b[tcarm], 0.1)
scalar sizese31 = round(_se[tcarm], 0.01)
scalar sizep31 = round(r(table)[4,2], 0.001)

scalar sizet32 = round(_b[size_dummy], 0.1)
scalar sizese32 = round(_se[size_dummy], 0.01)
scalar sizep32 = round(r(table)[4,4], 0.001)

scalar sizet33 = round(_b[tcarm_size], 0.1)
scalar sizese33 = round(_se[tcarm_size], 0.01)
scalar sizep33 = round(r(table)[4,3], 0.001)

scalar Nsize3 = e(N)

//Baseline Business Practices

regress e_training_score b_training_score tcarm tcarm_prac prac_dummy education_dummy age_dummy size_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar pract11 = round(_b[tcarm], 0.0001)
scalar pracse11 = round(_se[tcarm], 0.01)
scalar pracp11 = round(r(table)[4,2], 0.001)

scalar pract12 = round(_b[prac_dummy], 0.0001)
scalar pracse12 = round(_se[prac_dummy], 0.01)
scalar pracp12 = round(r(table)[4,4], 0.001)

scalar pract13 = round(_b[tcarm_prac], 0.0001)
scalar pracse13 = round(_se[tcarm_prac], 0.01)
scalar pracp13 = round(r(table)[4,3], 0.001)


scalar Nprac1 = e(N)

regress w1e_salesregwk w1b_salesregwk tcarm tcarm_prac prac_dummy education_dummy age_dummy size_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar pract21 = round(_b[tcarm], 0.1)
scalar pracse21 = round(_se[tcarm], 0.01)
scalar pracp21 = round(r(table)[4,2], 0.001)

scalar pract22 = round(_b[prac_dummy], 0.1)
scalar pracse22 = round(_se[prac_dummy], 0.01)
scalar pracp22 = round(r(table)[4,4], 0.001)

scalar pract23 = round(_b[tcarm_prac], 0.1)
scalar pracse23 = round(_se[tcarm_prac], 0.01)
scalar pracp23 = round(r(table)[4,3], 0.001)

scalar Nprac2 = e(N)

regress w1e_profitregwk w1b_profitregwk tcarm tcarm_prac prac_dummy education_dummy age_dummy size_dummy stratum b_urbanclas b_ageofbus b_bus_prime b_ownphone b_retailtype_new, cluster(groupid)

matrix list r(table)

scalar pract31 = round(_b[tcarm], 0.1)
scalar pracse31 = round(_se[tcarm], 0.01)
scalar pracp31 = round(r(table)[4,2], 0.001)

scalar pract32 = round(_b[prac_dummy], 0.1)
scalar pracse32 = round(_se[prac_dummy], 0.01)
scalar pracp32 = round(r(table)[4,4], 0.001)

scalar pract33 = round(_b[tcarm_prac], 0.1)
scalar pracse33 = round(_se[tcarm_prac], 0.01)
scalar pracp33 = round(r(table)[4,3], 0.001)

scalar Nprac3 = e(N)

clear

***********************************************
****************TABLE 5B VALUES****************
***********************************************

do "$FH/do/Scores/INDW1_HOC_Scores.do"

set more off
*******************************************************************************************
******************************************************************************************
//*RE-CLASSIFICATION OF BASELINE PARAMETERS*//

///CLASSIFICATION OF RETAIL TYPE INTO 3 NEW TYPES: "SHOP", "FOOD RETAIL" AND "NON-FOOD RETAIL"///
tab b_retailtype
tab b_retailtype, nol
gen b_retailtype_new = 1 if b_retailtype == 2
replace b_retailtype_new = 2 if b_retailtype == 1 | b_retailtype == 9 | b_retailtype == 11
replace b_retailtype_new = 3 if b_retailtype_new != 1 & b_retailtype_new != 2
replace b_retailtype_new = . if b_retailtype < 0
tab b_retailtype_new
label variable b_retailtype_new "Revised-Retail Type Classification"
label define retailnew 1"Shop" 2"Food Retail" 3"Non-food Retail"
label values b_retailtype_new retailnew
tab b_retailtype_new
tab b_retailtype_new, nol
tab b_retailtype_new, gen(b_retailtype_new_)

*********************************************************************************
///RE-CLASSIFICATION OF EDUCATION INTO 4 LEVELS: "LESS THAN 5TH CLASS", "ABOVE 5TH CLASS", "COMPLETED HIGH SCHOOL" & "GRADUATE/POST-GRADUATE"///
tab b_education
tab b_education, nol
gen b_education_new = 1 if b_education <= 2
replace b_education_new = 2 if b_education == 3
replace b_education_new = 3 if b_education == 4
replace b_education_new = 4 if b_education >= 5
replace b_education_new = . if b_education < 0
tab b_education_new
label variable b_education_new "Revised Education Level"
label define educationnew 1"Less than 5th Grade" 2"Above 5th Grade" 3"Completed High School" 4"Graduate/Post-Graduate"
label values b_education_new educationnew
tab b_education_new
tab b_education_new, nol
tab b_education_new, gen(b_education_new_)

**********************************************************************************
///RENAMING INDICATOR ON WHETHER A PERSON OWNS A PHONE///
rename b_qg1 b_ownphone
replace b_ownphone =. if b_ownphone < 0
tab b_ownphone
replace b_bus_prime =. if b_bus_prime < 0

**********************************************************************************
///RECLASSIFICATION OF EDUCATION INTO 2 LEVELS- HSGrad (high) vs otherwise (low)///
tab b_education
tab b_education, nol
gen b_education_new2 = 1 if b_education >= 4
replace b_education_new2 = 0 if b_education < 4 & b_education > 0
tab b_education_new
label variable b_education_new2 "Revised Education Levels-Binary"
label define educationnew2 0"Low" 1"High"
label values b_education_new2 educationnew2
tab b_education_new2
tab b_education_new2, nol

**********************************************************************************
///RECLASSIFICATION OF AGE OF BUSINESS INTO 2 GROUPS: OLD (>=3 yrs) VS YOUNG (<3 yrs)*/
tab b_ageofbus
gen b_ageofbus_new = 1 if b_ageofbus >= 3 & b_ageofbus <.
replace b_ageofbus_new = 0 if b_ageofbus < 3
tab b_ageofbus_new
label variable b_ageofbus_new "revised age of business"
label define ageofbusnew 0"young" 1"old"
label values b_ageofbus_new ageofbusnew
tab b_ageofbus_new
tab b_ageofbus_new, nol
******************************************************************************************************************
//*GENERATING CATEGORIES FOR AGE OF ENTREPRENEUR, BASELINE BUSINESS SIZE, BASELINE BUSINESS PRACTICES & LEVEL OF EDUCATION*//

//EDUCATION LEVEL
tab b_education
tab b_education_new2
tab b_education_new2, nol
//We will group education as follows: High School & Above coded as '0' and Less than High School as '1'
gen education_dummy =.
replace education_dummy = 0 if b_education_new2 == 1
replace education_dummy = 1 if b_education_new2 == 0
tab education_dummy
/*Generating Interaction Term*/
gen tcarm_education = tcarm*education_dummy
tab tcarm_education

//AGE OF ENTREPRENEUR
tab b_age
summarize b_age, de
//We will split age of entrepreneur as follows: Above Median Age coded as '0' and Below Median Age coded as '1'
gen age_dummy = .
replace age_dummy = 0 if b_age > 38 
replace age_dummy = 1 if b_age <= 38
tab age_dummy
/*Generating Interaction Term*/
gen tcarm_age = tcarm*age_dummy
tab tcarm_age

//BASELINE BUSINESS SIZE
summarize b_salesregwk, de
summarize w1b_salesregwk, de
//We will split business size as follows: Above median baseline regular week sales as '0' and Below and equal median regular week sales as '1'
gen size_dummy =. 
replace size_dummy = 0 if w1b_salesregwk > 10000
replace size_dummy = 1 if w1b_salesregwk <= 10000
tab size_dummy 
/*Generating Interaction Term*/
gen tcarm_size = tcarm*size_dummy 
tab tcarm_size

//BASELINE BUSINESS PRACTICES 
summarize b_training_score, de
//We will split business practices as follows: Above median baseline training score as '0' and Below and equal median training score as '1'
gen prac_dummy = .
replace prac_dummy = 0 if b_training_score > 1.6875
replace prac_dummy = 1 if b_training_score <= 1.6875
tab prac_dummy 
/*Generating Interaction Term*/
gen tcarm_prac = tcarm*prac_dummy 
tab tcarm_prac


reg e_training_score b_training_score tcarm tcarm_education education_dummy age_dummy size_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_edt11 = round(_b[tcarm], 0.0001)
scalar ind_edse11 = round(_se[tcarm], 0.01)
scalar ind_edp11 = round(r(table)[4,2], 0.001)

scalar ind_edt12 = round(_b[education_dummy], 0.0001)
scalar ind_edse12 = round(_se[education_dummy], 0.01)
scalar ind_edp12 = round(r(table)[4,4], 0.001)

scalar ind_edt13 = round(_b[tcarm_education], 0.0001)
scalar ind_edse13 = round(_se[tcarm_education], 0.01)
scalar ind_edp13 = round(r(table)[4,3], 0.001)

scalar ind_Ned1 = e(N)

reg w1e_salesregwk w1b_salesregwk tcarm tcarm_education education_dummy age_dummy size_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_edt21 = round(_b[tcarm], 0.1)
scalar ind_edse21 = round(_se[tcarm], 0.01)
scalar ind_edp21 = round(r(table)[4,2], 0.001)

scalar ind_edt22 = round(_b[education_dummy], 0.1)
scalar ind_edse22 = round(_se[education_dummy], 0.01)
scalar ind_edp22 = round(r(table)[4,4], 0.001)

scalar ind_edt23 = round(_b[tcarm_education], 0.1)
scalar ind_edse23 = round(_se[tcarm_education], 0.01)
scalar ind_edp23 = round(r(table)[4,3], 0.001)

scalar ind_Ned2 = e(N)

reg w1e_profitregwk w1b_profitregwk tcarm tcarm_education education_dummy age_dummy size_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_edt31 = round(_b[tcarm], 0.1)
scalar ind_edse31 = round(_se[tcarm], 0.01)
scalar ind_edp31 = round(r(table)[4,2], 0.001)

scalar ind_edt32 = round(_b[education_dummy], 0.1)
scalar ind_edse32 = round(_se[education_dummy], 0.01)
scalar ind_edp32 = round(r(table)[4,4], 0.001)

scalar ind_edt33 = round(_b[tcarm_education], 0.1)
scalar ind_edse33 = round(_se[tcarm_education], 0.01)
scalar ind_edp33 = round(r(table)[4,3], 0.001)

scalar ind_Ned3 = e(N)

///Age of Entrepreneur
reg e_training_score b_training_score tcarm tcarm_age age_dummy education_dummy size_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_aget11 = round(_b[tcarm], 0.0001)
scalar ind_agese11 = round(_se[tcarm], 0.01)
scalar ind_agep11 = round(r(table)[4,2], 0.001)

scalar ind_aget12 = round(_b[age_dummy], 0.0001)
scalar ind_agese12 = round(_se[age_dummy], 0.01)
scalar ind_agep12 = round(r(table)[4,4], 0.001)

scalar ind_aget13 = round(_b[tcarm_age], 0.0001)
scalar ind_agese13 = round(_se[tcarm_age], 0.01)
scalar ind_agep13 = round(r(table)[4,3], 0.001)


scalar ind_Nage1 = e(N)

reg w1e_salesregwk w1b_salesregwk tcarm tcarm_age age_dummy education_dummy size_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_aget21 = round(_b[tcarm], 0.1)
scalar ind_agese21 = round(_se[tcarm], 0.01)
scalar ind_agep21 = round(r(table)[4,2], 0.001)

scalar ind_aget22 = round(_b[age_dummy], 0.1)
scalar ind_agese22 = round(_se[age_dummy], 0.01)
scalar ind_agep22 = round(r(table)[4,4], 0.001)

scalar ind_aget23 = round(_b[tcarm_age], 0.1)
scalar ind_agese23 = round(_se[tcarm_age], 0.01)
scalar ind_agep23 = round(r(table)[4,3], 0.001)

scalar ind_Nage2 = e(N)

reg w1e_profitregwk w1b_profitregwk tcarm tcarm_age age_dummy education_dummy size_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_aget31 = round(_b[tcarm], 0.1)
scalar ind_agese31 = round(_se[tcarm], 0.01)
scalar ind_agep31 = round(r(table)[4,2], 0.001)

scalar ind_aget32 = round(_b[age_dummy], 0.1)
scalar ind_agese32 = round(_se[age_dummy], 0.01)
scalar ind_agep32 = round(r(table)[4,4], 0.001)

scalar ind_aget33 = round(_b[tcarm_age], 0.1)
scalar ind_agese33 = round(_se[tcarm_age], 0.01)
scalar ind_agep33 = round(r(table)[4,3], 0.001)

scalar ind_Nage3 = e(N)

***********************************************
****************TABLE 6B VALUES****************
***********************************************

//Size of Business

reg e_training_score b_training_score tcarm tcarm_size size_dummy age_dummy education_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_sizet11 = round(_b[tcarm], 0.0001)
scalar ind_sizese11 = round(_se[tcarm], 0.01)
scalar ind_sizep11 = round(r(table)[4,2], 0.001)

scalar ind_sizet12 = round(_b[size_dummy], 0.0001)
scalar ind_sizese12 = round(_se[size_dummy], 0.01)
scalar ind_sizep12 = round(r(table)[4,4], 0.001)

scalar ind_sizet13 = round(_b[tcarm_size], 0.0001)
scalar ind_sizese13 = round(_se[tcarm_size], 0.01)
scalar ind_sizep13 = round(r(table)[4,3], 0.001)


scalar ind_Nsize1 = e(N)

reg w1e_salesregwk w1b_salesregwk tcarm tcarm_size size_dummy age_dummy education_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_sizet21 = round(_b[tcarm], 0.1)
scalar ind_sizese21 = round(_se[tcarm], 0.01)
scalar ind_sizep21 = round(r(table)[4,2], 0.001)

scalar ind_sizet22 = round(_b[size_dummy], 0.1)
scalar ind_sizese22 = round(_se[size_dummy], 0.01)
scalar ind_sizep22 = round(r(table)[4,4], 0.001)

scalar ind_sizet23 = round(_b[tcarm_size], 0.1)
scalar ind_sizese23 = round(_se[tcarm_size], 0.01)
scalar ind_sizep23 = round(r(table)[4,3], 0.001)

scalar ind_Nsize2 = e(N)

reg w1e_profitregwk w1b_profitregwk tcarm tcarm_size size_dummy age_dummy education_dummy prac_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r


matrix list r(table)

scalar ind_sizet31 = round(_b[tcarm], 0.1)
scalar ind_sizese31 = round(_se[tcarm], 0.01)
scalar ind_sizep31 = round(r(table)[4,2], 0.001)

scalar ind_sizet32 = round(_b[size_dummy], 0.1)
scalar ind_sizese32 = round(_se[size_dummy], 0.01)
scalar ind_sizep32 = round(r(table)[4,4], 0.001)

scalar ind_sizet33 = round(_b[tcarm_size], 0.1)
scalar ind_sizese33 = round(_se[tcarm_size], 0.01)
scalar ind_sizep33 = round(r(table)[4,3], 0.001)

scalar ind_Nsize3 = e(N)

//Baseline Business Practices

reg e_training_score b_training_score tcarm tcarm_prac prac_dummy size_dummy age_dummy education_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_pract11 = round(_b[tcarm], 0.001)
scalar ind_pracse11 = round(_se[tcarm], 0.01)
scalar ind_pracp11 = round(r(table)[4,2], 0.001)

scalar ind_pract12 = round(_b[prac_dummy], 0.001)
scalar ind_pracse12 = round(_se[prac_dummy], 0.01)
scalar ind_pracp12 = round(r(table)[4,4], 0.001)

scalar ind_pract13 = round(_b[tcarm_prac], 0.001)
scalar ind_pracse13 = round(_se[tcarm_prac], 0.01)
scalar ind_pracp13 = round(r(table)[4,3], 0.001)


scalar ind_Nprac1 = e(N)

reg w1e_salesregwk w1b_salesregwk tcarm tcarm_prac prac_dummy size_dummy age_dummy education_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_pract21 = round(_b[tcarm], 0.1)
scalar ind_pracse21 = round(_se[tcarm], 0.01)
scalar ind_pracp21 = round(r(table)[4,2], 0.001)

scalar ind_pract22 = round(_b[prac_dummy], 0.1)
scalar ind_pracse22 = round(_se[prac_dummy], 0.01)
scalar ind_pracp22 = round(r(table)[4,4], 0.001)

scalar ind_pract23 = round(_b[tcarm_prac], 0.1)
scalar ind_pracse23 = round(_se[tcarm_prac], 0.01)
scalar ind_pracp23 = round(r(table)[4,3], 0.001)

scalar ind_Nprac2 = e(N)

reg w1e_profitregwk w1b_profitregwk tcarm tcarm_prac prac_dummy size_dummy age_dummy education_dummy i._branch b_gender _language b_ageofbus b_bus_prime b_ownphone b_retailtype_new, r

matrix list r(table)

scalar ind_pract31 = round(_b[tcarm], 0.1)
scalar ind_pracse31 = round(_se[tcarm], 0.01)
scalar ind_pracp31 = round(r(table)[4,2], 0.001)

scalar ind_pract32 = round(_b[prac_dummy], 0.1)
scalar ind_pracse32 = round(_se[prac_dummy], 0.01)
scalar ind_pracp32 = round(r(table)[4,4], 0.001)

scalar ind_pract33 = round(_b[tcarm_prac], 0.1)
scalar ind_pracse33 = round(_se[tcarm_prac], 0.01)
scalar ind_pracp33 = round(r(table)[4,3], 0.001)

scalar ind_Nprac3 = e(N)

clear

***********************************************
****************SHARPENED Q-VALUES*************
***********************************************
///Correcting for Family of Hypotheses pertaining to Business Practices
//PHILIPPINES

putexcel set "$FH/do/MHT/MHTCorr_Prac_PHL.xlsx", replace
putexcel A1= "pval"
putexcel A2= edp13
putexcel A3= agep13
putexcel A4= sizep13
putexcel A5= pracp13


clear

* Collect the total number of p-values tested

import excel using "$FH/do/MHT/MHTCorr_Prac_PHL.xlsx", firstrow

quietly sum pval
local totalpvals = r(N)

* Sort the p-values in ascending order and generate a variable that codes each p-value's rank

quietly gen int original_sorting_order = _n
quietly sort pval
quietly gen int rank = _n if pval~=.

* Set the initial counter to 1 

local qval = 1

* Generate the variable that will contain the BKY (2006) sharpened q-values

gen bky06_qval = 1 if pval~=.

* Set up a loop that begins by checking which hypotheses are rejected at q = 1.000, then checks which hypotheses are rejected at q = 0.999, then checks which hypotheses are rejected at q = 0.998, etc.  The loop ends by checking which hypotheses are rejected at q = 0.001.


while `qval' > 0 {
	* First Stage
	* Generate the adjusted first stage q level we are testing: q' = q/1+q
	local qval_adj = `qval'/(1+`qval')
	* Generate value q'*r/M
	gen fdr_temp1 = `qval_adj'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q'*r/M
	gen reject_temp1 = (fdr_temp1>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank1 = reject_temp1*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected1 = max(reject_rank1)

	* Second Stage
	* Generate the second stage q level that accounts for hypotheses rejected in first stage: q_2st = q'*(M/m0)
	local qval_2st = `qval_adj'*(`totalpvals'/(`totalpvals'-total_rejected1[1]))
	* Generate value q_2st*r/M
	gen fdr_temp2 = `qval_2st'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q_2st*r/M
	gen reject_temp2 = (fdr_temp2>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank2 = reject_temp2*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected2 = max(reject_rank2)

	* A p-value has been rejected at level q if its rank is less than or equal to the rank of the max p-value that meets the above condition
	replace bky06_qval = `qval' if rank <= total_rejected2 & rank~=.
	* Reduce q by 0.001 and repeat loop
	drop fdr_temp* reject_temp* reject_rank* total_rejected*
	local qval = `qval' - .001
}
	

quietly sort original_sorting_order


scalar sharp_edp13 = round(bky06_qval[1],0.001)
scalar sharp_agep13 = round(bky06_qval[2], 0.001)
scalar sharp_sizep13 = round(bky06_qval[3], 0.001)
scalar sharp_pracp13 = round(bky06_qval[4], 0.001)


clear
//INDIA

putexcel set "$FH/do/MHT/MHTCorr_Prac_IND.xlsx", replace
putexcel A1= "pval"
putexcel A2= ind_edp13
putexcel A3= ind_agep13
putexcel A4= ind_sizep13
putexcel A5= ind_pracp13

clear

* Collect the total number of p-values tested

import excel using "$FH/do/MHT/MHTCorr_Prac_IND.xlsx", firstrow

quietly sum pval
local totalpvals = r(N)

* Sort the p-values in ascending order and generate a variable that codes each p-value's rank

quietly gen int original_sorting_order = _n
quietly sort pval
quietly gen int rank = _n if pval~=.

* Set the initial counter to 1 

local qval = 1

* Generate the variable that will contain the BKY (2006) sharpened q-values

gen bky06_qval = 1 if pval~=.

* Set up a loop that begins by checking which hypotheses are rejected at q = 1.000, then checks which hypotheses are rejected at q = 0.999, then checks which hypotheses are rejected at q = 0.998, etc.  The loop ends by checking which hypotheses are rejected at q = 0.001.


while `qval' > 0 {
	* First Stage
	* Generate the adjusted first stage q level we are testing: q' = q/1+q
	local qval_adj = `qval'/(1+`qval')
	* Generate value q'*r/M
	gen fdr_temp1 = `qval_adj'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q'*r/M
	gen reject_temp1 = (fdr_temp1>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank1 = reject_temp1*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected1 = max(reject_rank1)

	* Second Stage
	* Generate the second stage q level that accounts for hypotheses rejected in first stage: q_2st = q'*(M/m0)
	local qval_2st = `qval_adj'*(`totalpvals'/(`totalpvals'-total_rejected1[1]))
	* Generate value q_2st*r/M
	gen fdr_temp2 = `qval_2st'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q_2st*r/M
	gen reject_temp2 = (fdr_temp2>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank2 = reject_temp2*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected2 = max(reject_rank2)

	* A p-value has been rejected at level q if its rank is less than or equal to the rank of the max p-value that meets the above condition
	replace bky06_qval = `qval' if rank <= total_rejected2 & rank~=.
	* Reduce q by 0.001 and repeat loop
	drop fdr_temp* reject_temp* reject_rank* total_rejected*
	local qval = `qval' - .001
}
	

quietly sort original_sorting_order


scalar sharp_ind_edp13 = round(bky06_qval[1], 0.001)
scalar sharp_ind_agep13 = round(bky06_qval[2], 0.001)
scalar sharp_ind_sizep13 = round(bky06_qval[3], 0.001)
scalar sharp_ind_pracp13 = round(bky06_qval[4], 0.001)


clear

///Correcting for Family of Hypotheses pertaining to Business Outcomes
//PHILIPPINES

putexcel set "$FH/do/MHT/MHTCorr_Out_PHL.xlsx", replace
putexcel A1= "pval"
putexcel A2= edp23
putexcel A3= agep23
putexcel A4= sizep23
putexcel A5= pracp23
putexcel A6= edp33
putexcel A7= agep33
putexcel A8= sizep33
putexcel A9= pracp33


clear

* Collect the total number of p-values tested

import excel using "$FH/do/MHT/MHTCorr_Out_PHL.xlsx", firstrow

quietly sum pval
local totalpvals = r(N)

* Sort the p-values in ascending order and generate a variable that codes each p-value's rank

quietly gen int original_sorting_order = _n
quietly sort pval
quietly gen int rank = _n if pval~=.

* Set the initial counter to 1 

local qval = 1

* Generate the variable that will contain the BKY (2006) sharpened q-values

gen bky06_qval = 1 if pval~=.

* Set up a loop that begins by checking which hypotheses are rejected at q = 1.000, then checks which hypotheses are rejected at q = 0.999, then checks which hypotheses are rejected at q = 0.998, etc.  The loop ends by checking which hypotheses are rejected at q = 0.001.


while `qval' > 0 {
	* First Stage
	* Generate the adjusted first stage q level we are testing: q' = q/1+q
	local qval_adj = `qval'/(1+`qval')
	* Generate value q'*r/M
	gen fdr_temp1 = `qval_adj'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q'*r/M
	gen reject_temp1 = (fdr_temp1>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank1 = reject_temp1*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected1 = max(reject_rank1)

	* Second Stage
	* Generate the second stage q level that accounts for hypotheses rejected in first stage: q_2st = q'*(M/m0)
	local qval_2st = `qval_adj'*(`totalpvals'/(`totalpvals'-total_rejected1[1]))
	* Generate value q_2st*r/M
	gen fdr_temp2 = `qval_2st'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q_2st*r/M
	gen reject_temp2 = (fdr_temp2>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank2 = reject_temp2*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected2 = max(reject_rank2)

	* A p-value has been rejected at level q if its rank is less than or equal to the rank of the max p-value that meets the above condition
	replace bky06_qval = `qval' if rank <= total_rejected2 & rank~=.
	* Reduce q by 0.001 and repeat loop
	drop fdr_temp* reject_temp* reject_rank* total_rejected*
	local qval = `qval' - .001
}
	

quietly sort original_sorting_order


scalar sharp_edp23 = round(bky06_qval[1], 0.001)
scalar sharp_agep23 = round(bky06_qval[2], 0.001)
scalar sharp_sizep23 = round(bky06_qval[3], 0.001)
scalar sharp_pracp23 = round(bky06_qval[4], 0.001)
scalar sharp_edp33 = round(bky06_qval[5], 0.001)
scalar sharp_agep33 = round(bky06_qval[6], 0.001)
scalar sharp_sizep33 = round(bky06_qval[7], 0.001)
scalar sharp_pracp33 = round(bky06_qval[8], 0.001)

clear
//INDIA

putexcel set "$FH/do/MHT/MHTCorr_Out_IND.xlsx", replace
putexcel A1= "pval"
putexcel A2= ind_edp23
putexcel A3= ind_agep23
putexcel A4= ind_sizep23
putexcel A5= ind_pracp23
putexcel A6= ind_edp33
putexcel A7= ind_agep33
putexcel A8= ind_sizep33
putexcel A9= ind_pracp33

clear

* Collect the total number of p-values tested

import excel using "$FH/do/MHT/MHTCorr_Out_IND.xlsx", firstrow

quietly sum pval
local totalpvals = r(N)

* Sort the p-values in ascending order and generate a variable that codes each p-value's rank

quietly gen int original_sorting_order = _n
quietly sort pval
quietly gen int rank = _n if pval~=.

* Set the initial counter to 1 

local qval = 1

* Generate the variable that will contain the BKY (2006) sharpened q-values

gen bky06_qval = 1 if pval~=.

* Set up a loop that begins by checking which hypotheses are rejected at q = 1.000, then checks which hypotheses are rejected at q = 0.999, then checks which hypotheses are rejected at q = 0.998, etc.  The loop ends by checking which hypotheses are rejected at q = 0.001.


while `qval' > 0 {
	* First Stage
	* Generate the adjusted first stage q level we are testing: q' = q/1+q
	local qval_adj = `qval'/(1+`qval')
	* Generate value q'*r/M
	gen fdr_temp1 = `qval_adj'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q'*r/M
	gen reject_temp1 = (fdr_temp1>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank1 = reject_temp1*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected1 = max(reject_rank1)

	* Second Stage
	* Generate the second stage q level that accounts for hypotheses rejected in first stage: q_2st = q'*(M/m0)
	local qval_2st = `qval_adj'*(`totalpvals'/(`totalpvals'-total_rejected1[1]))
	* Generate value q_2st*r/M
	gen fdr_temp2 = `qval_2st'*rank/`totalpvals'
	* Generate binary variable checking condition p(r) <= q_2st*r/M
	gen reject_temp2 = (fdr_temp2>=pval) if pval~=.
	* Generate variable containing p-value ranks for all p-values that meet above condition
	gen reject_rank2 = reject_temp2*rank
	* Record the rank of the largest p-value that meets above condition
	egen total_rejected2 = max(reject_rank2)

	* A p-value has been rejected at level q if its rank is less than or equal to the rank of the max p-value that meets the above condition
	replace bky06_qval = `qval' if rank <= total_rejected2 & rank~=.
	* Reduce q by 0.001 and repeat loop
	drop fdr_temp* reject_temp* reject_rank* total_rejected*
	local qval = `qval' - .001
}
	

quietly sort original_sorting_order


scalar sharp_ind_edp23 = round(bky06_qval[1], 0.001)
scalar sharp_ind_agep23 = round(bky06_qval[2], 0.001)
scalar sharp_ind_sizep23 = round(bky06_qval[3], 0.001)
scalar sharp_ind_pracp23 = round(bky06_qval[4], 0.001)
scalar sharp_ind_edp33 = round(bky06_qval[5], 0.001)
scalar sharp_ind_agep33 = round(bky06_qval[6], 0.001)
scalar sharp_ind_sizep33 = round(bky06_qval[7], 0.001)
scalar sharp_ind_pracp33 = round(bky06_qval[8], 0.001)

clear





***********************************************
****************GENERATING TABLE 5A************
***********************************************

file open Table5A using "$FH/tables/Table5A.tex", write replace text
set more off 
file write Table5A 							"\documentclass[12pt]{article}"  _n 
file write Table5A							"\usepackage{amsmath}"   _n 
file write Table5A							"\usepackage{latexsym}"   _n 
file write Table5A							"\usepackage{amsfonts}"   _n 
file write Table5A							"\usepackage{xcolor}"    _n 
file write Table5A							"\usepackage{booktabs}"   _n 
file write Table5A							"\usepackage{tabularx}"   _n 
file write Table5A							"\usepackage{adjustbox}"   _n 
file write Table5A							"\begin{document}"   _n 
file write Table5A							"\begin{table}[htbp]"   _n 
file write Table5A							"\begin{adjustbox}{width=1.1\textwidth}"   _n 
file write Table5A							"\centering" _n  
file write Table5A							"\begin{tabular}{p{16.335em}ccccccc}"   _n 
file write Table5A							"\multicolumn{8}{c}{\textbf{TABLE 5A: HETEROGENEOUS IMPACT OF TRAINING}} \\"   _n 
file write Table5A							"\midrule"   _n 
file write Table5A							"\midrule"   _n 
file write Table5A							"\multicolumn{1}{l}{} & \multicolumn{7}{c}{\textbf{PHILIPPINES}} \\"   _n 
file write Table5A							"\cmidrule{2-4}\cmidrule{6-8}    \multicolumn{1}{l}{} & \multicolumn{3}{c}{\textbf{Level of Education}} &       	& 			  \multicolumn{3}{c}{\textbf{Age of Entrepreneur}} \\"   _n 
file write Table5A							"\cmidrule{2-4}\cmidrule{6-8}    \textit{\textbf{Outcome Variables}} & {\textbf{Treatment}} & {\textbf{Low}} & {\textbf{Treatment}} &       & {\textbf{Treatment}} & {\textbf{Old}} & {\textbf{Treatment}} \\"   _n 
file write Table5A							"& & & {\textbf{*Low}} &       &  &  & {\textbf{*Old}} \\"   _n 
file write Table5A							"\midrule"   _n 
file write Table5A							"\multicolumn{1}{l}{\textbf{Business Practices Index}} & " (edt11) "* & " (edt12) " & " (edt13) "  &  & " (aget11) "***  & " (aget12) "**  & " (aget13) "**  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (edse11) ")  & (" (edse12) ")  & (" (edse13) ")  &  & (" (agese11) ") & (" (agese12) ")  & (" (agese13) ") \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{P-Value}} & " (edp11) "  & " (edp12) "  & " (edp13) " &  & " (agep11) "  & " (agep12) " & " (agep13) " \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_edp13) "  &       &       &       & " (sharp_agep13) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{N}} & " (Ned1) " & " (Ned1) "  & " (Ned1) "  &       & " (Nage1) " & " (Nage1) "  & " (Nage1) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textbf{Regular Week Sales-Winsorized at 1\%}} & " (edt21) "  & " (edt22) "  & " (edt23) "  &  & " (aget21) "  & " (aget22) "  & " (aget23) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (edse21) ") & (" (edse22) ")  & (" (edse23) ")  &  & (" (agese21) ")  & (" (agese22) ")  & (" (agese23) ")  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{P-Value}} & " (edp21) "  & " (edp22) " & " (edp23) " &  & " (agep21) "  & " (agep22) " & " (agep23) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_edp23) " &       &       &       & " (sharp_agep23) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{N}} & " (Ned2) "   & " (Ned2) "   & " (Ned2) "   &  & " (Nage2) "  & " (Nage2) "   & " (Nage2) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textbf{Regular Week Profits-Winsorized at 1\%}} & " (edt31) "  & " (edt32) "  & " (edt33) "  & & " (aget31) "* & " (aget32) " & " (aget33) " \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (edse31) ")  & (" (edse32) ")  & (" (edse33) ")  & & (" (agese31) ")  & (" (agese32) ")  & (" (agese33) ")  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{P-Value}} & " (edp31) " &  " (edp32) "    & " (edp33) " &  & " (agep31) " & " (agep32) " & " (agep33) "  \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_edp33) "  &       &       &       & " (sharp_agep33) " \\"   _n 
file write Table5A							"\multicolumn{1}{l}{\textit{N}} & " (Ned3) "   & " (Ned3) "   & " (Ned3) "   &  & " (Nage3) "  & " (Nage3) "   & " (Nage3) "  \\"   _n 
file write Table5A							"\midrule"   _n 
file write Table5A							"\midrule"   _n 
file write Table5A							"\multicolumn{8}{p{58em}}{{Notes: This table presents heterogeneous treatment effect using interaction terms. We regress endline business outcome on treatment dummy, subgroup variable, and the interaction between treatment dummy and subgroup variable, controlling for covariates. Covariates include age of business, own a cellphone indicator, primary source of income indicator, education level, business type, and variables used for stratification. Heteroskedasticity-robust standard errors in parentheses. Sharpened q-values that correct for multiple hypothesis testing are also presented * Denotes significance at 10\%-level, ** at the 5\%-level, and *** at the 1\%-level the 5\%-level, and *** at the 1\%-level}} \\" _n 
file write Table5A							"\bottomrule"   _n 
file write Table5A							"\end{tabular}%"   _n 
file write Table5A							"\label{tab:addlabel}%"   _n 
file write Table5A							"\end{adjustbox}"   _n 
file write Table5A							"\end{table}%" _n
file write Table5A							"\end{document}" 


file close Table5A
set more on

***********************************************
****************GENERATING TABLE 6A************
***********************************************

file open table6a using "$FH/tables/Table6A.tex", write replace text
set more off 
file write table6a 							"\documentclass[12pt]{article}"  _n 
file write table6a							"\usepackage{amsmath}"   _n 
file write table6a							"\usepackage{latexsym}"   _n 
file write table6a							"\usepackage{amsfonts}"   _n 
file write table6a							"\usepackage{xcolor}"    _n 
file write table6a							"\usepackage{booktabs}"   _n 
file write table6a							"\usepackage{tabularx}"   _n 
file write table6a							"\usepackage{adjustbox}"   _n 
file write table6a							"\begin{document}"   _n 
file write table6a							"\begin{table}[htbp]"   _n 
file write table6a							"\begin{adjustbox}{width=1.1\textwidth}"   _n 
file write table6a							"\centering" _n  
file write table6a							"\begin{tabular}{p{16.335em}ccccccc}"   _n 
file write table6a							"\multicolumn{8}{c}{\textbf{TABLE 6A: HETEROGENEOUS IMPACT OF TRAINING}} \\"   _n 
file write table6a							"\midrule"   _n 
file write table6a							"\midrule"   _n 
file write table6a							"\multicolumn{1}{l}{} & \multicolumn{7}{c}{\textbf{PHILIPPINES}} \\"   _n 
file write table6a							"\cmidrule{2-4}\cmidrule{6-8}    \multicolumn{1}{l}{} & \multicolumn{3}{c}{\textbf{Size of Business}} &       	& 			  \multicolumn{3}{c}{\textbf{Baseline Business Practices}} \\"   _n 
file write table6a							"\cmidrule{2-4}\cmidrule{6-8}    \textit{\textbf{Outcome Variables}} & {\textbf{Treatment}} & {\textbf{Small}} & {\textbf{Treatment}} &       & {\textbf{Treatment}} & {\textbf{Low Score}} & {\textbf{Treatment}} \\"   _n 
file write table6a							"& & & {\textbf{*Small}} &       &  &  & {\textbf{*Low}} \\"   _n 
file write table6a							"\midrule"   _n 
file write table6a							"\multicolumn{1}{l}{\textbf{Business Practices Index}} & " (sizet11) " & " (sizet12) "* & " (sizet13) "*  &  & " (pract11) "  & " (pract12) "  & " (pract13) "  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (sizese11) ")  & (" (sizese12) ")  & (" (sizese13) ")  &  & (" (pracse11) ") & (" (pracse12) ")  & (" (pracse13) ") \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{P-Value}} & " (sizep11) "  & " (sizep12) "  & " (sizep13) " &  & " (pracp11) "  & " (pracp12) " & " (pracp13) " \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_sizep13) " &       &       &       & " (sharp_pracp13) " \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{N}} & " (Nsize1) " & " (Nsize1) "  & " (Nsize1) "  &       & " (Nprac1) " & " (Nprac1) "  & " (Nprac1) "  \\"   _n 
file write table6a							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textbf{Regular Week Sales-Winsorized at 1\%}} & " (sizet21) "*  & " (sizet22) "  & " (sizet23) "*  &  & " (pract21) "  & " (pract22) "*  & " (pract23) "  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (sizese21) ") & (" (sizese22) ")  & (" (sizese23) ")  &  & (" (pracse21) ")  & (" (pracse22) ")  & (" (pracse23) ")  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{P-Value}} & " (sizep21) "  & " (sizep22) " & " (sizep23) " &  & " (pracp21) "  & " (pracp22) " & " (pracp23) "  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_sizep23) " &       &       &       & " (sharp_pracp23) " \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{N}} & " (Nsize2) "   & " (Nsize2) "   & " (Nsize2) "   &  & " (Nprac2) "  & " (Nprac2) "   & " (Nprac2) "  \\"   _n 
file write table6a							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textbf{Regular Week Profits-Winsorized at 1\%}} & " (sizet31) "*  & " (sizet32) "***  & " (sizet33) "**  & & " (pract31) " & " (pract32) " & " (pract33) " \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (sizese31) ")  & (" (sizese32) ")  & (" (sizese33) ")  & & (" (pracse31) ")  & (" (pracse32) ")  & (" (pracse33) ")  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{P-Value}} & " (sizep31) " &  " (sizep32) "    & " (sizep33) " &  & " (pracp31) " & " (pracp32) " & " (pracp33) "  \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_sizep33) "  &       &       &       & " (sharp_pracp33) " \\"   _n 
file write table6a							"\multicolumn{1}{l}{\textit{N}} & " (Nsize3) "   & " (Nsize3) "   & " (Nsize3) "   &  & " (Nprac3) "  & " (Nprac3) "   & " (Nprac3) "  \\"   _n 
file write table6a							"\midrule"   _n 
file write table6a							"\midrule"   _n 
file write table6a							"\multicolumn{8}{p{58em}}{{Notes: This table presents heterogeneous treatment effect using interaction terms. We regress endline business outcome on treatment dummy, subgroup variable, and the interaction between treatment dummy and subgroup variable, controlling for covariates. Covariates include age of business, own a cellphone indicator, primary source of income indicator, education level, business type, and variables used for stratification. Heteroskedasticity-robust standard errors in parentheses. Sharpened q-values that correct for multiple hypothesis testing are also presented * Denotes significance at 10\%-level, ** at the 5\%-level, and *** at the 1\%-level the 5\%-level, and *** at the 1\%-level}} \\" _n 
file write table6a							"\bottomrule"   _n 
file write table6a							"\end{tabular}%"   _n 
file write table6a							"\label{tab:addlabel}%"   _n 
file write table6a							"\end{adjustbox}"   _n 
file write table6a							"\end{table}%" _n
file write table6a							"\end{document}" 


file close table6a
set more on
	

***********************************************
****************GENERATING TABLE 5B************
***********************************************
file open table5b using "$FH/tables/Table5B.tex", write replace text
set more off 
file write table5b 							"\documentclass[12pt]{article}"  _n 
file write table5b							"\usepackage{amsmath}"   _n 
file write table5b							"\usepackage{latexsym}"   _n 
file write table5b							"\usepackage{amsfonts}"   _n 
file write table5b							"\usepackage{xcolor}"    _n 
file write table5b							"\usepackage{booktabs}"   _n 
file write table5b							"\usepackage{tabularx}"   _n 
file write table5b							"\usepackage{adjustbox}"   _n 
file write table5b							"\begin{document}"   _n 
file write table5b							"\begin{table}[htbp]"   _n 
file write table5b							"\begin{adjustbox}{width=1.1\textwidth}"   _n 
file write table5b							"\centering" _n  
file write table5b							"\begin{tabular}{p{16.335em}ccccccc}"   _n 
file write table5b							"\multicolumn{8}{c}{\textbf{TABLE 5B: HETEROGENEOUS IMPACT OF TRAINING}} \\"   _n 
file write table5b							"\midrule"   _n 
file write table5b							"\midrule"   _n 
file write table5b							"\multicolumn{1}{l}{} & \multicolumn{7}{c}{\textbf{INDIA}} \\"   _n 
file write table5b							"\cmidrule{2-4}\cmidrule{6-8}    \multicolumn{1}{l}{} & \multicolumn{3}{c}{\textbf{Level of Education}} &       	& 			  \multicolumn{3}{c}{\textbf{Age of Entrepreneur}} \\"   _n 
file write table5b							"\cmidrule{2-4}\cmidrule{6-8}    \textit{\textbf{Outcome Variables}} & {\textbf{Treatment}} & {\textbf{Low}} & {\textbf{Treatment}} &       & {\textbf{Treatment}} & {\textbf{Old}} & {\textbf{Treatment}} \\"   _n 
file write table5b							"& & & {\textbf{*Low}} &       &  &  & {\textbf{*Old}} \\"   _n 
file write table5b							"\midrule"   _n 
file write table5b							"\multicolumn{1}{l}{\textbf{Business Practices Index}} & " (ind_edt11) " & " (ind_edt12) "*** & " (ind_edt13) "  &  & " (ind_aget11) "  & " (ind_aget12) "  & " (ind_aget13) "  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (ind_edse11) ")  & (" (ind_edse12) ")  & (" (ind_edse13) ")  &  & (" (ind_agese11) ") & (" (ind_agese12) ")  & (" (ind_agese13) ") \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{P-Value}} & " (ind_edp11) "  & " (ind_edp12) "  & " (ind_edp13) " &  & " (ind_agep11) "  & " (ind_agep12) " & " (ind_agep13) " \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_ind_edp13) " &       &       &       & " (sharp_ind_agep23) " \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{N}} & " (ind_Ned1) " & " (ind_Ned1) "  & " (ind_Ned1) "  &       & " (ind_Nage1) " & " (ind_Nage1) "  & " (ind_Nage1) "  \\"   _n 
file write table5b							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textbf{Regular Week Sales-Winsorized at 1\%}} & " (ind_edt21) "  & " (ind_edt22) "  & " (ind_edt23) "  &  & " (ind_aget21) "  & " (ind_aget22) "  & " (ind_aget23) "  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (ind_edse21) ") & (" (ind_edse22) ")  & (" (ind_edse23) ")  &  & (" (ind_agese21) ")  & (" (ind_agese22) ")  & (" (ind_agese23) ")  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{P-Value}} & " (ind_edp21) "  & " (ind_edp22) " & " (ind_edp23) " &  & " (ind_agep21) "  & " (ind_agep22) " & " (ind_agep23) "  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_ind_edp23) " &       &       &       & " (sharp_ind_agep23) " \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{N}} & " (ind_Ned2) "   & " (ind_Ned2) "   & " (ind_Ned2) "   &  & " (ind_Nage2) "  & " (ind_Nage2) "   & " (ind_Nage2) "  \\"   _n 
file write table5b							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textbf{Regular Week Profits-Winsorized at 1\%}} & " (ind_edt31) "  & " (ind_edt32) "**  & " (ind_edt33) "  & & " (ind_aget31) " & " (ind_aget32) " & " (ind_aget33) " \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (ind_edse31) ")  & (" (ind_edse32) ")  & (" (ind_edse33) ")  & & (" (ind_agese31) ")  & (" (ind_agese32) ")  & (" (ind_agese33) ")  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{P-Value}} & " (ind_edp31) " &  " (ind_edp32) "    & " (ind_edp33) " &  & " (ind_agep31) " & " (ind_agep32) " & " (ind_agep33) "  \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_ind_edp33) "  &       &       &       & " (sharp_ind_agep33) " \\"   _n 
file write table5b							"\multicolumn{1}{l}{\textit{N}} & " (ind_Ned3) "   & " (ind_Ned3) "   & " (ind_Ned3) "   &  & " (ind_Nage3) "  & " (ind_Nage3) "   & " (ind_Nage3) "  \\"   _n 
file write table5b							"\midrule"   _n 
file write table5b							"\midrule"   _n 
file write table5b							"\multicolumn{8}{p{58em}}{{Notes: This table presents heterogeneous treatment effect using interaction terms. We regress endline business outcome on treatment dummy, subgroup variable, and the interaction between treatment dummy and subgroup variable, controlling for covariates. Covariates include age of business, own a cellphone indicator, primary source of income indicator, education level, business type, and variables used for stratification. Heteroskedasticity-robust standard errors in parentheses. Sharpened q-values that correct for multiple hypothesis testing are also presented * Denotes significance at 10\%-level, ** at the 5\%-level, and *** at the 1\%-level the 5\%-level, and *** at the 1\%-level}} \\" _n 
file write table5b							"\bottomrule"   _n 
file write table5b							"\end{tabular}%"   _n 
file write table5b							"\label{tab:addlabel}%"   _n 
file write table5b							"\end{adjustbox}"   _n 
file write table5b							"\end{table}%" _n
file write table5b							"\end{document}" 


file close table5b
set more on



***********************************************
****************GENERATING TABLE 6B************
***********************************************
file open table6b using "$FH/tables/Table6B.tex", write replace text
set more off 
file write table6b 							"\documentclass[12pt]{article}"  _n 
file write table6b							"\usepackage{amsmath}"   _n 
file write table6b							"\usepackage{latexsym}"   _n 
file write table6b							"\usepackage{amsfonts}"   _n 
file write table6b							"\usepackage{xcolor}"    _n 
file write table6b							"\usepackage{booktabs}"   _n 
file write table6b							"\usepackage{tabularx}"   _n 
file write table6b							"\usepackage{adjustbox}"   _n 
file write table6b							"\begin{document}"   _n 
file write table6b							"\begin{table}[htbp]"   _n 
file write table6b							"\begin{adjustbox}{width=1.1\textwidth}"   _n 
file write table6b							"\centering" _n  
file write table6b							"\begin{tabular}{p{16.335em}ccccccc}"   _n 
file write table6b							"\multicolumn{8}{c}{\textbf{TABLE 6B: HETEROGENEOUS IMPACT OF TRAINING}} \\"   _n 
file write table6b							"\midrule"   _n 
file write table6b							"\midrule"   _n 
file write table6b							"\multicolumn{1}{l}{} & \multicolumn{7}{c}{\textbf{PHILIPPINES}} \\"   _n 
file write table6b							"\cmidrule{2-4}\cmidrule{6-8}    \multicolumn{1}{l}{} & \multicolumn{3}{c}{\textbf{Size of Business}} &       	& 			  \multicolumn{3}{c}{\textbf{Baseline Business Practices}} \\"   _n 
file write table6b							"\cmidrule{2-4}\cmidrule{6-8}    \textit{\textbf{Outcome Variables}} & {\textbf{Treatment}} & {\textbf{Small}} & {\textbf{Treatment}} &       & {\textbf{Treatment}} & {\textbf{Low Score}} & {\textbf{Treatment}} \\"   _n 
file write table6b							"& & & {\textbf{*Small}} &       &  &  & {\textbf{*Low}} \\"   _n 
file write table6b							"\midrule"   _n 
file write table6b							"\multicolumn{1}{l}{\textbf{Business Practices Index}} & " (ind_sizet11) " & " (ind_sizet12) " & " (ind_sizet13) "  &  & " (ind_pract11) "  & " (ind_pract12) "  & " (ind_pract13) "*  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (ind_sizese11) ")  & (" (ind_sizese12) ")  & (" (ind_sizese13) ")  &  & (" (ind_pracse11) ") & (" (ind_pracse12) ")  & (" (ind_pracse13) ") \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{P-Value}} & " (ind_sizep11) "  & " (ind_sizep12) "  & " (ind_sizep13) " &  & " (ind_pracp11) "  & " (ind_pracp12) " & " (ind_pracp13) " \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_ind_sizep13) " &       &       &       & " (sharp_ind_pracp13) " \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{N}} & " (ind_Nsize1) " & " (ind_Nsize1) "  & " (ind_Nsize1) "  &       & " (ind_Nprac1) " & " (ind_Nprac1) "  & " (ind_Nprac1) "  \\"   _n 
file write table6b							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textbf{Regular Week Sales-Winsorized at 1\%}} & " (ind_sizet21) "  & " (ind_sizet22) "  & " (ind_sizet23) "  &  & " (ind_pract21) "  & " (ind_pract22) "  & " (ind_pract23) "  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (ind_sizese21) ") & (" (ind_sizese22) ")  & (" (ind_sizese23) ")  &  & (" (ind_pracse21) ")  & (" (ind_pracse22) ")  & (" (ind_pracse23) ")  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{P-Value}} & " (ind_sizep21) "  & " (ind_sizep22) " & " (ind_sizep23) " &  & " (ind_pracp21) "  & " (ind_pracp22) " & " (ind_pracp23) "  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_ind_sizep23) " &       &       &       & " (sharp_ind_pracp23) " \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{N}} & " (ind_Nsize2) "   & " (ind_Nsize2) "   & " (ind_Nsize2) "   &  & " (ind_Nprac2) "  & " (ind_Nprac2) "   & " (ind_Nprac2) "  \\"   _n 
file write table6b							"\multicolumn{1}{l}{} &       &       &       &       &       &       &  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textbf{Regular Week Profits-Winsorized at 1\%}} & " (ind_sizet31) "  & " (ind_sizet32) "***  & " (ind_sizet33) "  & & " (ind_pract31) " & " (ind_pract32) " & " (ind_pract33) " \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{Standard Error}} & (" (ind_sizese31) ")  & (" (ind_sizese32) ")  & (" (ind_sizese33) ")  & & (" (ind_pracse31) ")  & (" (ind_pracse32) ")  & (" (ind_pracse33) ")  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{P-Value}} & " (ind_sizep31) " &  " (ind_sizep32) "    & " (ind_sizep33) " &  & " (ind_pracp31) " & " (ind_pracp32) " & " (ind_pracp33) "  \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{Sharpened q-value}} &       &       & " (sharp_ind_sizep33) "  &       &       &       & " (sharp_ind_pracp13) " \\"   _n 
file write table6b							"\multicolumn{1}{l}{\textit{N}} & " (ind_Nsize3) "   & " (ind_Nsize3) "   & " (ind_Nsize3) "   &  & " (ind_Nprac3) "  & " (ind_Nprac3) "   & " (ind_Nprac3) "  \\"   _n 
file write table6b							"\midrule"   _n 
file write table6b							"\midrule"   _n 
file write table6b							"\multicolumn{8}{p{58em}}{{Notes: This table presents heterogeneous treatment effect using interaction terms. We regress endline business outcome on treatment dummy, subgroup variable, and the interaction between treatment dummy and subgroup variable, controlling for covariates. Covariates include age of business, own a cellphone indicator, primary source of income indicator, education level, business type, and variables used for stratification. Heteroskedasticity-robust standard errors in parentheses. Sharpened q-values that correct for multiple hypothesis testing are also presented * Denotes significance at 10\%-level, ** at the 5\%-level, and *** at the 1\%-level the 5\%-level, and *** at the 1\%-level}} \\" _n 
file write table6b							"\bottomrule"   _n 
file write table6b							"\end{tabular}%"   _n 
file write table6b							"\label{tab:addlabel}%"   _n 
file write table6b							"\end{adjustbox}"   _n 
file write table6b							"\end{table}%" _n
file write table6b							"\end{document}" 


file close table6b
set more on

clear
